const axios = require("axios");

let LoginLoad = false; //假设登录按钮禁用为false,也就是可以点击按钮

async function getBook() {
  try {
    LoginLoad = true; //登录按钮禁用打开，然后不能点击按钮
    console.log("code line-7 \n\r😁 LoginLoad:\n\r", LoginLoad);

    const page = 1;
    const item = 10;
    const name = "";
    const req = await axios.get(
      "http://localhost:8080/api/book/select/" +
        page +
        "/" +
        item +
        "?name=" +
        name
    );
    console.log("code line-6 \n\r😒 req:\n\r", req.data);
  } catch (e) {
    console.log(e);
  } finally {
    console.log("请求结束");
    LoginLoad = false; //请求结束，将这个禁用打开
    console.log("code line-26 \n\r😔 LoginLoad:\n\r", LoginLoad);
  }
}
getBook();
